//import org.apache.logging.log4j.LogManager;
//import org.apache.logging.log4j.Logger;
//import org.apache.logging.log4j.core.config.ConfigurationSource;
//import org.apache.logging.log4j.core.config.Configurator;
//
//import java.io.*;
////cannot work
//public class CustomerLoggerPathTest {
//    public static void main(String[] args) throws IOException {
//        File file = new File("D:/log4j2.xml") ;
//        BufferedInputStream bufferedInputStream = null;
//        try {
//            bufferedInputStream = new BufferedInputStream(new FileInputStream(file));
//            final ConfigurationSource configurationSource = new ConfigurationSource(bufferedInputStream);
//            Configurator.initialize(null, configurationSource);
//
//            Logger logger = LogManager.getLogger("defaultLogger");
//            logger.debug("hello");
//        } catch (FileNotFoundException e) {
//            e.printStackTrace();
//        } finally {
//            bufferedInputStream.close();
//        }
//    }
//}
